<%-- 
    Document   : create
    Created on : 2011-06-18, 23:58:49
    Author     : Mirek
--%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>

<%@taglib prefix="f" uri="http://java.sun.com/jsf/core"%>
<%@taglib prefix="h" uri="http://java.sun.com/jsf/html"%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">

<f:view>
    <html>
        <head>
            <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
            <title>JSP Page</title>
            <link rel="stylesheet" type="text/css" href="media/css/common.css" />
            <link rel="stylesheet" type="text/css" href="../media/css/common.css" />
            <link rel="stylesheet" type="text/css" href="media/css/form.css" />
            <link rel="stylesheet" type="text/css" href="../media/css/form.css" />
        </head>
        <body>
            <h:form>
                <h:commandLink action="index" value="Powrót do strony głównej" />
            </h:form>
            <div id="main-wrapper">
                <h1>Rejestracja</h1>
                <p>Aby móc zamówić ksiażki musisz utworzyć konto. Rejestracja jest bardzo prosta i nie zajmie Ci więcej niż minutę.</p>
                <h:form id="register">

                    <div>
                        <label for="name">Imię:</label>
                        <h:inputText id="name" value="#{registrationHelper.name}" required="true" >
                            <f:validateLength maximum="30" minimum="3" />
                        </h:inputText>
                        <h:message for="name" styleClass="form-error"/> 
                    </div>

                    <div>
                        <label for="surname">Nazwisko:</label>
                        <h:inputText id="surname" value="#{registrationHelper.surname}" required="true" >
                            <f:validateLength maximum="35" minimum="3" />
                        </h:inputText>
                        <h:message for="surname" styleClass="form-error"/>
                    </div>
                    
                    <div>
                        <label for="address">Adres:</label>
                        <h:inputText id="address" value="#{registrationHelper.address}" required="true" >
                            <f:validateLength maximum="155" minimum="3" />
                        </h:inputText>
                    </div>
                    
                    <div>
                        <label for="login">Login:</label>
                        <h:inputText id="login" value="#{registrationHelper.login}" required="true" >
                            <f:validateLength maximum="20" minimum="3" />
                        </h:inputText>
                        <h:message for="login" styleClass="form-error"/>
                    </div>
                    
                    <div>
                        <label for="password">Hasło:</label>
                        <h:inputSecret id="password" value="#{registrationHelper.password}" redisplay="false" required="true">
                            <f:validateLength maximum="25" minimum="3" />
                        </h:inputSecret>
                        <h:message for="password" styleClass="form-error"/>
                    </div>
                    
                    <h:commandButton action="#{registrationHelper.create}" value="Utwórz konto" styleClass="submit"/>
                </h:form>
            </div>
        </body>
    </html>
</f:view>
